import * as express from 'express'
import { basic } from '../controller/nodeVideo/basic'
import { action } from '../controller/nodeVideo/actions'
import { imageUpload, videoUpload, uploadError } from "../middleware/upload.middleware";
import { formData } from "../middleware/formData.middleware";

const indexRoute: express.Router = express.Router()


indexRoute.get('/getProjectList', basic.getProjectList)
indexRoute.get('/getProjectDetails', formData, basic.getProjectDetails)
indexRoute.post('/createProject', imageUpload.single("background"), uploadError, basic.createProject)
indexRoute.post('/deleteProject', formData, basic.deleteProject)
indexRoute.post('/editProjectCover', imageUpload.single("background"), uploadError, basic.editProjectCover)
indexRoute.post('/editProjectDetails', formData, basic.editProjectDetails)


indexRoute.get('/action/nodeInfoList', action.nodeInfoList)
indexRoute.post('/action/uploadNodeList', formData, action.uploadNodeList)
indexRoute.post('/action/clearNodeList', formData, action.clearNodeList)
indexRoute.post('/action/uploadNodeInfo', formData, action.uploadNodeInfo)
indexRoute.post('/action/deleteNodeInfo', formData, action.deleteNodeInfo)
indexRoute.get('/action/videoList', action.videoList)
indexRoute.post('/action/uploadVideo', videoUpload.array("video"), uploadError, action.uploadVideo)
indexRoute.post('/action/deleteVideo', formData, action.deleteVideo)
/// 视频下载路由
indexRoute.get('/action/downloadVideo', formData, action.downloadVideo)

export default indexRoute